#pragma once
#include "libMediaPusher.h"
#include "EasyPusherAPI.h"
#pragma comment(lib, "libEasyPusher.lib")

class libMediaPushWorker
{
public:
	libMediaPushWorker();
	~libMediaPushWorker();
public:
	void MediaCapData_CB(int nType, char* pBuff, int nBuffLen, bool bKeyFrame);
	void Set_SPSAndPPS(unsigned char*sps, long&spslen, unsigned char*pps, long&ppslen);
	void RunPushTH();

	void Init(std::string strIP, int nPort, std::string strSDPName, EasyPusher_Callback cbCall);
	void Release();

private:
	Easy_Pusher_Handle m_hRTSPHandle;
	std::thread *m_pThreadPush;
	std::list<EASY_AV_Frame*> m_ListMediaData;
	std::mutex m_lockMedia;
	bool m_bInitOK;
	bool m_bExit;

	unsigned char m_sps[100];
	unsigned char m_pps[100];
	long m_spslen;
	long m_ppslen;
};

